using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting;

namespace GatewayDemo
{
    public class Program
    {
        /**
         *
         *
          var builder = WebApplication.CreateBuilder(args);
builder.Services.AddReverseProxy()
    .LoadFromConfig(builder.Configuration.GetSection("ReverseProxy"));
var app = builder.Build();
app.MapReverseProxy();
app.Run();
         * **/

        public static void Main(string[] args)
        {
            //  var builder = WebApplication.CreateBuilder(args);
            CreateHostBuilder(args).Build().Run();
        }

        public static IHostBuilder CreateHostBuilder(string[] args) =>
            Host.CreateDefaultBuilder(args)
                //  .UseAgileConfig(e => Console.WriteLine($"configs {e.Action}"))
                .ConfigureWebHostDefaults(webBuilder =>
                {
                    //webBuilder.ConfigureServices(a => {
                    //    a.AddReverseProxy().LoadFromConfig(webBuilder.ConfigureServices.GetSection("ReverseProxy"));
                    //});
                    webBuilder.UseStartup<Startup>();
                });
    }
}